<!--
 * @Author: your name
 * @Date: 2019-11-19 10:32:15
 * @LastEditTime: 2019-11-23 10:51:04
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \YouYouFo\you-you-go\src\views\goods\GoodsDetail.vue
 -->
<template>
  <div>
    <h4></h4>
    <hr />
    <div class="goodsContentBox"></div>
    <!-- <div class="goodsContentBox">{{info[0].content}}</div> -->
  </div>
</template>
           
<script>
import { getgoodsDetail } from '@/api/index.js'
export default {
  data() {
    return {
      id: this.$route.params.id,
      info: []
    }
  },
  created() {
    this.getDeailInfo(this.id)
    // console.log(this.info)
  },
  methods: {
    async getDeailInfo(id) {
      const { data: res } = await getgoodsDetail(id)
      this.info = res.message
      this.$nextTick(_ => {
        document.querySelector('h4').innerHTML = this.info[0].title
        document.querySelector('.goodsContentBox').innerHTML = this.info[0].content
      })
    }
  }
}
</script>
<style lang="less" scoped>
h4 {
  text-align: center;
  font-size: 16px;
  color: #226aff;
  margin: 55px 0 15px;
}
p {
  margin: 15px 0;
}
.goodsContentBox {
  padding: 0 10px;
}
</style>